package tech.aistar.mapper.news;


import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tech.aistar.entity.News;

import java.util.List;

/**
 * Created by Administrator on 2019/9/27 0027.
 */
@Repository
public interface NewsMapper {
    @Select("select * from news")
    List<News> newsFindAll();

    @Select("select * from news where id=#{value}")
   News newsFindOne(Integer id);

    @Update("update news set status = 1 where id = #{value}")
    void newdelById(Integer id);


    @Insert("insert into news(userinfo_id,news_content,news_time,status,serid) values(#{userinfoId},#{newsContent},#{newsTime},#{status},#{serid})")
    void newsAdd(News news);
}
